import axios from 'axios'
import basePath from '@/api/api.js'
let baseapi = basePath.pathUrl().imapi
let baserest = basePath.pathUrl().imrest
let basehm = basePath.pathUrl().imheal
let baseWechat = basePath.pathUrl().imapiwechat

import $ from "jquery"
/*同步获取加密时间*/
export function getbaseTime(type){
  var time = new Date().getTime();
  $.ajax({
    type: 'get',
    url: `${baserest}/mjk/common/current/time`,
    dataType: "json",
    async: false,
    success: function (result) {
      if(result.status == 200){
        if(type==1){
          time = result.data.current_time
        }else{
          time = result.data.current_hourMin
        }
      }
    }
  })
  return time
}
/*微信jsSdkSign签名*/
export const apiJsSdkSign = params => { return axios.get(`${baseWechat}/wechat/jsSdkSign/mjk`, {params: params} ) }
/*banner*/
export const apibanner = params => { return axios.get(`${baseapi}/im/third/banner`, {params: params} ) }
/*获取用户信息*/
export const apiGetsig = params => { return axios.get(`${baseapi}/im/third/user/getUserInfo`, {params: params} ) }
/*获取群成员信息*/
export const apiGroupMember = params => { return axios.post(`${baseapi}/im/third/campGroup/getCampGroupMemberDetail`, params ) }
/*获取健康管理师信息*/
export const apiGetHmInfo = params => { return axios.get(`${baseapi}/im/third/healthMgr/getHealthManager`, {params: params} ) }
/*获取训练营群列表（群聊）*/
export const apiGetGroupList = params => { return axios.post(`${baseapi}/im/third/campGroup/getCampGroupRelationList`, params ) }
// export const apiGetGroupList = params => { return axios.post(`${basehm}/im/third/campGroup/getCampGroupRelationList`, params ) }
/*获取用户与管理师关系列表(单聊)*/
export const apiGetC2CList = params => { return axios.post(`${baseapi}/im/third/healthMgr/getUserHealthMgrRelation`, params ) }
/*群组艾特*/
export const apithirdmjknotify = params => { return axios.post(`${basehm}/im/third/mjk/customNotify`, params ) }
// export const apithirdmjknotify = params => { return axios.post(`${baseapi}/im/third/message/sendMonitorMsg`, params ) }
/*获取用户当前任务的执行进度*/
export const apiplanprocess = params => { return axios.get(`${baseapi}/v1/order/orderProcess`, {params: params} ) }

/*获取聊天历史记录C2C*/
export const apiGetmoreC2cMessage= params => { return axios.post(`${baseapi}/im/third/chat/getClientC2CChatRecord`, params ) }
/*获取聊天历史记录GROUP*/
export const apiGetmoreGroupMessage= params => { return axios.post(`${baseapi}/im/third/chat/getClientGroupChatRecord`, params ) }
